;
(function(win) {
	var ControlEngine = function() {
		return new ControlEngine.init();
	}

	var controlEngineProps = ControlEngine.prototype;
	ControlEngine.init = function() {};
	ControlEngine.init.prototype = controlEngineProps;
	ControlEngine.version = {};
	ControlEngine.version.number = "1.0.0.RELEASE";
	ControlEngine.version.author = "yumi@omuao.com";
	controlEngineProps.setWorldOptions = function(options) {
		this.worldOptions = options;
	}

	win.ControlEngine = ControlEngine;

	//初始化控制引擎
	if(win.JadeEngine != null && typeof win.JadeEngine !== "undefined") {
		JadeEngine.World.prototype.setControlEngine = function(controlEngine) {
			if(!controlEngine instanceof ControlEngine) {
				throw "ControlEngine is not set";
			}
			controlEngine.setWordOptions(this);
			this.controlEngine = controlEngine;
			return this.controlEngine;
		}
		JadeEngine.World.prototype.getControlEngine = function() {
			if(this.controlEngine == null || typeof this.controlEngine === "undefined") {
				this.controlEngine = new ControlEngine();
				this.controlEngine.setWorldOptions(this);
			}
			return this.controlEngine;
		}
		JadeEngine.World.prototype.getControlEngineVersionInfo = function() {
			return ControlEngine.version;
		}
	}
}(window));